<?php
session_start();
	require_once dirname( __FILE__ ) . '/form-process.php';  
	
	$pageURL = 'http';
	if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
		$pageURL .= "://";
	if ($_SERVER["SERVER_PORT"] != "80") {
		$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
	} else {
		$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
	}
	
	$action= $pageURL;
?>
<?php get_header(); ?>
<div id="content">
	<div class="left">    	
        <form action="" method="post" name="adduser" id="adduser" onsubmit="return check_form(this);" enctype="multipart/form-data" >
        <input name="action" type="hidden" id="action" value="adduser" />
        <input name="action_type" type="hidden" id="action_type" value="register" />
        <?php wp_nonce_field('add-user') ?>							
        <?php
        //Load up the passed data, else set to a default.
        foreach ( array('user_login' => 'login', 'first_name' => 'firstname', 'last_name' => 'lastname',
        'email' => 'email', 'url' => 'uri', 'role'=>'role') as $post_field => $var ) 
        {
            $var = "new_user_$var";
            if ( ! isset($$var) )
                $$var = isset($_POST[$post_field]) ? stripslashes($_POST[$post_field]) : '';
        }
        if($error!="")
            echo "<div class=\"err\">$error</div>";				
        if ( (isset($add_user_errors) && is_wp_error( $add_user_errors )) && $error=="" ) :
        ?>
        <div class="err">
            <?php
            foreach ( $add_user_errors->get_error_messages() as $message )
            echo "$message<br/>";
            ?>
        </div>
        <?php endif; ?>	
									<h3>User Name: </h3> &nbsp;<input type="text" name="user_login" id="user_login" size="30" value="<?php echo esc_attr($new_user_login); ?>"/><br/>
								
									<h3>Password: </h3> &nbsp;<input type="password" id="pass1" name="pass1" size="30"/><label style="width:auto; margin-left:10px;">
								
									<h3>Retype password: </h3><input type="password" id="pass2" name="pass2" size="30px"/>
										
                                    <h3>Email Address: </h3><input type="text" name="email" id="email" size="30px" value="<?php echo esc_attr($new_user_email); ?>"/>   					
									
									<h3>First Name: </h3><input type="text" name="first_name" id="first_name" size="30px" value="<?php echo esc_attr($new_user_firstname); ?>"/>								
							
									<h3>Last Name: </h3><div class="bg_input"><input type="text" name="last_name" id="last_name" size="30px" value="<?php echo esc_attr($new_user_lastname); ?>" />
                                    
									<h3>User Avata:</h3>
					<input type="file" name="avata" id="avata" value=""  size="40px" style=" border:1px solid #C7C7C7;" size="51"/>
                    
                                <div style="display:none;">
                                <label for="pass1">Role <span ></span></label>
                                <select name="role" id="role">
                                    <option value="employer">Employer</option>
                                </select>
                                
                                <div class="cl"></div>
                                </div>						
								<br/>
                                	
 								<input type="submit" name="adduser" value="Register" class="button" value="<?php esc_attr_e('Create Account'); ?>" />
								
							</div>	
                    </form>
            </div> 
  <?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
